﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace HotelMgr.Models
{
    public class Notice
    {
        [Key]
        public int NoticeID { get; set; }

        [StringLength(50)]
        [Required(ErrorMessage = "*")]
        [DisplayName("标题")]
        public string NoticeTitle { get; set; }

        [StringLength(512)]
        [Required(ErrorMessage = "*")]
        [DisplayName("内容")]
        public string NoticeContent { get; set; }

        [Required(ErrorMessage = "*")]
        [DisplayName("添加时间")]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd hh:mm:ss}")]
        public DateTime AddDate { get; set; }

        [DisplayName("过期时间")]
        [DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "无", ApplyFormatInEditMode = true,
            DataFormatString = "{0:yyyy-MM-dd hh:mm:ss}")]
        public DateTime? InvalidDate { get; set; }

    }
}